package cn.xiuxius.embedded.keil;

import lombok.Getter;

@Getter
public enum MemoryModel {
    SMALL(0),
    COMPACT(1),
    LARGE(2),
    UNKNOWN(-1);

    private final int num;

    MemoryModel(int num) {
        this.num = num;
    }

    public static MemoryModel fromNum(int num) {
        for (MemoryModel memoryModel : values()) {
            if (memoryModel.num == num) {
                return memoryModel;
            }
        }
        return UNKNOWN;
    }

}
